package personal.jinhui.paprika.service.aidl;

import personal.jinhui.paprika.service.Contact;
import personal.jinhui.paprika.service.aidl.IChat;
import personal.jinhui.paprika.service.aidl.IMessageListener;
import personal.jinhui.paprika.service.aidl.IChatListener;

/**
 * Aidl interface for a chat manager.
 * The chat manager will manage all the chat sessions.
 */
interface IChatManager {

    /**
   	* Create a chat session with a contact.
    * @param contact	the contact to chat with
    * @param listener	the callback to call when a new message comes from this chat session
    * @return 		the chat session
    */
	IChat createChat(in Contact contact, in IMessageListener listener);

	/**
	 * Get an existing Chat session with a contact.
	 * @return null if the chat session does not exist.
	 */
	IChat getChat(in Contact contact);
	
	/**
    * Destroy a chat session with a contact.
    * @param chat	the chat session
    */
	void destroyChat(in IChat iChat);

    /**
	 * @param chat the chat.
     */
	void deleteChatNotification(in IChat iChat);

	/**
	 * Register a callback to call when a chat changes.
	 * @param listener	the callback to add
	 */
	void addChatListener(in IChatListener listener);

	/**
	 * Remove a callback for a chat.
	 * @param listener	the callback to remove.
	 */
	void removeChatListener(in IChatListener listener);

}
